﻿IF EXISTS (SELECT * FROM sysobjects WHERE type = 'P' AND name = 'proc_cm_AddSmallGroupMember')
BEGIN
    PRINT 'Dropping Procedure proc_cm_AddSmallGroupMember'
    DROP  Procedure  proc_cm_AddSmallGroupMember
END
GO

PRINT 'Creating Procedure proc_cm_AddSmallGroupMember'
GO

CREATE PROCEDURE [dbo].[proc_cm_AddSmallGroupMember]
	@pSmallGroupId uniqueidentifier,
	@pMemberId int
AS
BEGIN
	SET NOCOUNT ON

	INSERT INTO [dbo].[tbl_member_smallgroup]
           ([member_id]
           ,[smallgroup_id]
           ,[joined_dttm])
     VALUES
           (@pMemberId
           ,@pSmallGroupId
           ,GETDATE())
END
GO

GRANT EXEC ON dbo.proc_cm_AddSmallGroupMember TO PUBLIC
GO
